package com.blog.common.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 文件
 * </p>
 *
 * @author Valerie
 * @since 2023-03-11
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_file_info")
@ApiModel(value = "FileInfo对象", description = "文件")
public class FileInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("文件id")
    @TableId("id")
    private Long id;

    @ApiModelProperty("文件名")
    @TableField("file_name")
    private String fileName;

    @ApiModelProperty("文件路径")
    @TableField("file_path")
    private String filePath;

    @ApiModelProperty("源路径")
    @TableField("origin_path")
    private String originPath;

    @ApiModelProperty("cdn加速路径")
    @TableField("cdn_path")
    private String cdnPath;

    @ApiModelProperty("文件类型：0 本地文件 1 云文件")
    @TableField("file_type")
    private Integer fileType;

    @ApiModelProperty("文件大小")
    @TableField("file_size")
    private Long fileSize;

    @ApiModelProperty("分辨率")
    @TableField("resolution_ratio")
    private Long resolutionRatio;

    @ApiModelProperty("md5")
    @TableField("md5")
    private String md5;

    @ApiModelProperty("备注 ")
    @TableField("remark")
    private String remark;

    @ApiModelProperty("下载次数")
    @TableField("downloads_amount")
    private Integer downloadsAmount;

    @ApiModelProperty("上传日期")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("修改日期")
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("是否删除: 0 未删除 1 已删除")
    @TableField("is_delete")
    @TableLogic
    private Integer isDelete;

    @ApiModelProperty("使用状态: 0 可用 1 禁用")
    @TableField("status")
    private Integer status;

}
